﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace LearnCSharp.SqlMap.Extension
{
    public class FieldInfo
    {
        private FieldInfo() { }

        public FieldInfo(string propertyName, string dataType, string name)
        {
            this._propertyName = propertyName;
            this._name = name;
            this._dataType = dataType;
        }

        public PropertyInfo PropertyInfo {  get; set; }
        private string _propertyName { get; set; }
        private string _name { get; set; }
        public string Name
        {
            get
            {
                if (string.IsNullOrEmpty(_name))
                {
                    return _propertyName;
                }
                return _name;
            }
            private set
            {
                if (_name == value) return;
                _name = value;
            }
        }


        private string _dataType { get; set; }
        public string DataType
        {
            get
            {
                return _dataType;
            }
            private set
            {
                if (_dataType == value) return;
                _dataType = value;
            }
        }
    }
}
